package cn.kgc.mes.service.impl;

import java.util.List;
import cn.kgc.mes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kgc.mes.mapper.CheckMachineryMapper;
import cn.kgc.mes.domain.CheckMachinery;
import cn.kgc.mes.service.ICheckMachineryService;

/**
 * 点检设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-16
 */
@Service
public class CheckMachineryServiceImpl implements ICheckMachineryService 
{
    @Autowired
    private CheckMachineryMapper checkMachineryMapper;

    /**
     * 查询点检设备
     * 
     * @param recordId 点检设备主键
     * @return 点检设备
     */
    @Override
    public CheckMachinery selectCheckMachineryByRecordId(Long recordId)
    {
        return checkMachineryMapper.selectCheckMachineryByRecordId(recordId);
    }

    /**
     * 查询点检设备列表
     * 
     * @param checkMachinery 点检设备
     * @return 点检设备
     */
    @Override
    public List<CheckMachinery> selectCheckMachineryList(CheckMachinery checkMachinery)
    {
        return checkMachineryMapper.selectCheckMachineryList(checkMachinery);
    }

    /**
     * 新增点检设备
     * 
     * @param checkMachinery 点检设备
     * @return 结果
     */
    @Override
    public int insertCheckMachinery(CheckMachinery checkMachinery)
    {
        checkMachinery.setCreateTime(DateUtils.getNowDate());
        return checkMachineryMapper.insertCheckMachinery(checkMachinery);
    }

    /**
     * 修改点检设备
     * 
     * @param checkMachinery 点检设备
     * @return 结果
     */
    @Override
    public int updateCheckMachinery(CheckMachinery checkMachinery)
    {
        checkMachinery.setUpdateTime(DateUtils.getNowDate());
        return checkMachineryMapper.updateCheckMachinery(checkMachinery);
    }

    /**
     * 批量删除点检设备
     * 
     * @param recordIds 需要删除的点检设备主键
     * @return 结果
     */
    @Override
    public int deleteCheckMachineryByRecordIds(Long[] recordIds)
    {
        return checkMachineryMapper.deleteCheckMachineryByRecordIds(recordIds);
    }

    /**
     * 删除点检设备信息
     * 
     * @param recordId 点检设备主键
     * @return 结果
     */
    @Override
    public int deleteCheckMachineryByRecordId(Long recordId)
    {
        return checkMachineryMapper.deleteCheckMachineryByRecordId(recordId);
    }
}
